package JZ44_翻转单词序列;

public class Solution {
    public String ReverseSentence(String str) {
        String[] s = str.split(" ");
        String res = "";
        for (int i = s.length - 1; i >= 0; i--){
            res = res + s[i];
            if (i != 0){
                res = res + " ";
            }
        }
        return res;
    }
}